home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / monochrome.swf / scripts / frame_10 / PlaceObject2_481_405 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Encoding:
Text File  |  2005-08-26  |  2.2 KB  |  91 lines

  1. onClipEvent(enterFrame){
  2.    if(_name != "shipWARP")
  3.    {
  4.       if(_currentframe == 1)
  5.       {
  6.          if(began == 0)
  7.          {
  8.             _Y = _Y + 3;
  9.             if(_Y > 100)
  10.             {
  11.                began = 1;
  12.             }
  13.          }
  14.          else
  15.          {
  16.             xspeed = speed * Math.sin((_rotation * -1 + 180) * 0.017453292519943295);
  17.             yspeed = speed * Math.cos((_rotation * -1 + 180) * 0.017453292519943295);
  18.             _X = _X + xspeed;
  19.             _Y = _Y + yspeed;
  20.             _rotation = _rotation + rspeed * speed;
  21.             xx = random(10);
  22.             if(xx == 0)
  23.             {
  24.                rspeed *= -1;
  25.             }
  26.             xx = random(100);
  27.             if(xx == 0)
  28.             {
  29.                speed = 13;
  30.                rspeed = 1.2;
  31.                timer = 75 + random(50);
  32.             }
  33.             timer -= 1;
  34.             if(timer == 0)
  35.             {
  36.                speed = 6;
  37.                rspeed = 0.6;
  38.             }
  39.             yy = random(50);
  40.             if(yy == 0)
  41.             {
  42.                _root.fire(this);
  43.             }
  44.             if(_X < rad)
  45.             {
  46.                _rotation = -1 * _rotation;
  47.                _X = rad;
  48.             }
  49.             if(_X > 550 - rad)
  50.             {
  51.                _rotation = -1 * _rotation;
  52.                _X = 550 - rad;
  53.             }
  54.             if(_Y > 400 - rad)
  55.             {
  56.                _rotation = -1 * _rotation + 180;
  57.                _Y = 400 - rad;
  58.             }
  59.             if(_Y < rad)
  60.             {
  61.                _rotation = -1 * _rotation + 180;
  62.                _Y = rad;
  63.             }
  64.             if(_root.ship.sh.hitTest(sh.harea))
  65.             {
  66.                _root.ship.play();
  67.             }
  68.          }
  69.          var i = 0;
  70.          while(i <= 20)
  71.          {
  72.             if(sh.harea.hitTest(_root["hmn" + i]))
  73.             {
  74.                life -= _root["hmn" + i].dmg;
  75.                sh.play();
  76.                removeMovieClip(_root["hmn" + i]);
  77.             }
  78.             i++;
  79.          }
  80.          if(life <= 0)
  81.          {
  82.             play();
  83.          }
  84.       }
  85.       if(_root.rem == true)
  86.       {
  87.          removeMovieClip(this);
  88.       }
  89.    }
  90. }
  91.